Skip to content

[6.4.x] Sema: Improve UseAnyAppleOSAvailability diagnostics#88974

Open
tshortli wants to merge 4 commits intoswiftlang:release/6.4.xfrom
tshortli:improve-use-any-apple-os-diags-6.4.x
Open

[6.4.x] Sema: Improve UseAnyAppleOSAvailability diagnostics#88974
tshortli wants to merge 4 commits intoswiftlang:release/6.4.xfrom
tshortli:improve-use-any-apple-os-diags-6.4.x

Conversation

@tshortli
Copy link
Copy Markdown
Contributor

@tshortli tshortli commented May 8, 2026

  • Explanation: A collection of improvements to UseAnyAppleOSAvailability diagnostics:
    • Avoid diagnosing @_spi_available attributes.
    • Avoid diagnosing attributes on implicit decls.
    • Offer fix-its for more complex combinations of @available attributes.
    • Generally improve fix-its that would remove all the non-whitespace text on a line so that they remove the entire line instead.
  • Scope: Affects projects that use the opt-in UseAnyAppleOSAvailability diagnostic.
  • Issue/Radar: dar://175677817
  • Original PR: Sema: Improve UseAnyAppleOSAvailability diagnostics #88886
  • Risk: Low. The modified warnings are only emitted for projects that opt-in (and no clients are expected yet).
  • Testing: Updated compiler tests.
  • Reviewer: @DougGregor

tshortli added 4 commits May 8, 2026 14:42
If the fix-it would remove a range that is followed by a newline and the
remaining text on the line is empty or all whitespace then remove the entire
line. This produces better results when a fix-it removes an attribute that is
written on a line by itself.
…inations.

Expand the fix-its to cover declarations with availability that is split
accross multiple attributes instead listed together in a single short form
`@available` attribute.

Resolves rdar://175677817.
@tshortli tshortli requested a review from a team as a code owner May 8, 2026 21:48
@tshortli
Copy link
Copy Markdown
Contributor Author

tshortli commented May 8, 2026

@swift-ci please test

@tshortli tshortli enabled auto-merge May 8, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants